transform: Make category public API
authorBenjamin Otte <otte@redhat.com>
Fri, 1 Mar 2019 06:51:23 +0000 (07:51 +0100)
committerBenjamin Otte <otte@redhat.com>
Mon, 4 Mar 2019 22:15:24 +0000 (23:15 +0100)
Also rename it from GskMatrixCategory to GskTransformCategory.

15 files changed:
docs/reference/gsk/gsk4-sections.txt
gsk/gl/gskglrenderer.c
gsk/gl/gskglrenderops.c
gsk/gl/gskglrenderopsprivate.h
gsk/gskenums.h
gsk/gskrendernodeimpl.c
gsk/gskrendernodeprivate.h
gsk/gsktransform.c
gsk/gsktransform.h
gsk/gsktransformprivate.h
gtk/gtksnapshot.c
gtk/gtksnapshotprivate.h
gtk/gtkwidget.c
gtk/gtkwidgetprivate.h
gtk/inspector/recorder.c

index 026613dc691530c02cd6b635963b0ad70189366e..3b544f6b45eafa1de1beaba83641f7a6da916696 100644 (file)
@@ -152,6 +152,9 @@ GskTransform
 gsk_transform_ref
 gsk_transform_unref
 <SUBSECTION>
+GskTransformCategory
+gsk_transform_get_category
+<SUBSECTION>
 gsk_transform_print
 gsk_transform_to_string
 gsk_transform_to_matrix
index 0724f2d2f1486de1dca0357c6d1392378ee78c11..4054bf8e9555a440fdc691b1173c8469fc1cca2a 100644 (file)
@@ -796,16 +796,16 @@ render_transform_node (GskGLRenderer   *self,
                        RenderOpBuilder *builder)
 {
   GskTransform *node_transform = gsk_transform_node_get_transform (node);
-  const GskMatrixCategory category = gsk_transform_categorize (node_transform);
+  const GskTransformCategory category = gsk_transform_get_category (node_transform);
   GskRenderNode *child = gsk_transform_node_get_child (node);
 
   switch (category)
     {
-    case GSK_MATRIX_CATEGORY_IDENTITY:
+    case GSK_TRANSFORM_CATEGORY_IDENTITY:
       gsk_gl_renderer_add_render_ops (self, child, builder);
     break;
 
-    case GSK_MATRIX_CATEGORY_2D_TRANSLATE:
+    case GSK_TRANSFORM_CATEGORY_2D_TRANSLATE:
       {
         float dx, dy;
         
@@ -820,7 +820,7 @@ render_transform_node (GskGLRenderer   *self,
       }
     break;
 
-    case GSK_MATRIX_CATEGORY_2D_AFFINE:
+    case GSK_TRANSFORM_CATEGORY_2D_AFFINE:
       {
         graphene_matrix_t mat;
 
@@ -831,9 +831,10 @@ render_transform_node (GskGLRenderer   *self,
       }
     break;
 
-    case GSK_MATRIX_CATEGORY_UNKNOWN:
-    case GSK_MATRIX_CATEGORY_ANY:
-    case GSK_MATRIX_CATEGORY_INVERTIBLE:
+    case GSK_TRANSFORM_CATEGORY_UNKNOWN:
+    case GSK_TRANSFORM_CATEGORY_ANY:
+    case GSK_TRANSFORM_CATEGORY_3D:
+    case GSK_TRANSFORM_CATEGORY_2D:
     default:
       {
         const float min_x = child->bounds.origin.x;
@@ -1426,7 +1427,7 @@ render_outset_shadow_node (GskGLRenderer       *self,
       op.op = OP_CLEAR;
       ops_add (builder, &op);
       prev_projection = ops_set_projection (builder, &item_proj);
-      ops_set_modelview (builder, &identity, GSK_MATRIX_CATEGORY_IDENTITY);
+      ops_set_modelview (builder, &identity, GSK_TRANSFORM_CATEGORY_IDENTITY);
       prev_viewport = ops_set_viewport (builder, &GRAPHENE_RECT_INIT (0, 0, texture_width, texture_height));
 
       /* Draw outline */
@@ -2644,7 +2645,7 @@ add_offscreen_ops (GskGLRenderer         *self,
   op.op = OP_CLEAR;
   ops_add (builder, &op);
   prev_projection = ops_set_projection (builder, &item_proj);
-  ops_set_modelview (builder, &identity, GSK_MATRIX_CATEGORY_IDENTITY);
+  ops_set_modelview (builder, &identity, GSK_TRANSFORM_CATEGORY_IDENTITY);
   prev_viewport = ops_set_viewport (builder,
                                     &GRAPHENE_RECT_INIT (bounds->origin.x * scale,
                                                          bounds->origin.y * scale,
@@ -2905,7 +2906,7 @@ gsk_gl_renderer_do_render (GskRenderer           *renderer,
   render_op_builder.current_opacity = 1.0f;
   render_op_builder.render_ops = self->render_ops;
   ops_set_modelview (&render_op_builder, &modelview,
-                     scale_factor == 1 ? GSK_MATRIX_CATEGORY_IDENTITY : GSK_MATRIX_CATEGORY_2D_AFFINE);
+                     scale_factor == 1 ? GSK_TRANSFORM_CATEGORY_IDENTITY : GSK_TRANSFORM_CATEGORY_2D_AFFINE);
 
   /* Initial clip is self->render_region! */
   if (self->render_region != NULL)
index ee5e19b479077726cceae98a5b339f36005db285..beb94a596749cbca20e486b7cee23277a1dc6272 100644 (file)
@@ -65,22 +65,23 @@ extract_matrix_metadata (const graphene_matrix_t *m,
 {
   switch (md->category)
     {
-    case GSK_MATRIX_CATEGORY_IDENTITY:
+    case GSK_TRANSFORM_CATEGORY_IDENTITY:
       md->scale_x = 1;
       md->scale_y = 1;
     break;
 
-    case GSK_MATRIX_CATEGORY_2D_TRANSLATE:
+    case GSK_TRANSFORM_CATEGORY_2D_TRANSLATE:
       md->translate_x = graphene_matrix_get_value (m, 3, 0);
       md->translate_y = graphene_matrix_get_value (m, 3, 1);
       md->scale_x = 1;
       md->scale_y = 1;
     break;
 
-    case GSK_MATRIX_CATEGORY_UNKNOWN:
-    case GSK_MATRIX_CATEGORY_ANY:
-    case GSK_MATRIX_CATEGORY_INVERTIBLE:
-    case GSK_MATRIX_CATEGORY_2D_AFFINE:
+    case GSK_TRANSFORM_CATEGORY_UNKNOWN:
+    case GSK_TRANSFORM_CATEGORY_ANY:
+    case GSK_TRANSFORM_CATEGORY_3D:
+    case GSK_TRANSFORM_CATEGORY_2D:
+    case GSK_TRANSFORM_CATEGORY_2D_AFFINE:
       {
         graphene_vec3_t col1;
         graphene_vec3_t col2;
@@ -121,21 +122,22 @@ ops_transform_bounds_modelview (const RenderOpBuilder *builder,
 
   switch (head->metadata.category)
     {
-    case GSK_MATRIX_CATEGORY_IDENTITY:
+    case GSK_TRANSFORM_CATEGORY_IDENTITY:
       *dst = *src;
       break;
 
-    case GSK_MATRIX_CATEGORY_2D_TRANSLATE:
+    case GSK_TRANSFORM_CATEGORY_2D_TRANSLATE:
       *dst = *src;
       dst->origin.x += head->metadata.translate_x;
       dst->origin.y += head->metadata.translate_y;
       break;
 
     /* TODO: Handle scale */
-    case GSK_MATRIX_CATEGORY_2D_AFFINE:
-    case GSK_MATRIX_CATEGORY_UNKNOWN:
-    case GSK_MATRIX_CATEGORY_ANY:
-    case GSK_MATRIX_CATEGORY_INVERTIBLE:
+    case GSK_TRANSFORM_CATEGORY_UNKNOWN:
+    case GSK_TRANSFORM_CATEGORY_ANY:
+    case GSK_TRANSFORM_CATEGORY_3D:
+    case GSK_TRANSFORM_CATEGORY_2D:
+    case GSK_TRANSFORM_CATEGORY_2D_AFFINE:
     default:
       graphene_matrix_transform_bounds (builder->current_modelview,
                                         src,
@@ -333,7 +335,7 @@ ops_set_modelview_internal (RenderOpBuilder         *builder,
 void
 ops_set_modelview (RenderOpBuilder         *builder,
                    const graphene_matrix_t *mv,
-                   GskMatrixCategory        mv_category)
+                   GskTransformCategory     mv_category)
 {
   MatrixStackEntry *entry;
 
@@ -363,7 +365,7 @@ ops_set_modelview (RenderOpBuilder         *builder,
 void
 ops_push_modelview (RenderOpBuilder         *builder,
                     const graphene_matrix_t *mv,
-                    GskMatrixCategory        mv_category)
+                    GskTransformCategory     mv_category)
 {
   float scale = ops_get_scale (builder);
   MatrixStackEntry *entry;
index e80d6882599873eee4bc787addd33ce4d38d5453..f54440aa308a3ca5d761f77e3fb1f878f93e8b66 100644 (file)
@@ -25,7 +25,7 @@ typedef struct
   float dx_before;
   float dy_before;
 
-  GskMatrixCategory category;
+  GskTransformCategory category;
 } OpsMatrixMetadata;
 
 typedef struct
@@ -281,10 +281,10 @@ void              ops_dump_framebuffer   (RenderOpBuilder         *builder,
 void              ops_finish             (RenderOpBuilder         *builder);
 void              ops_push_modelview     (RenderOpBuilder         *builder,
                                           const graphene_matrix_t *mv,
-                                          GskMatrixCategory        mv_category);
+                                          GskTransformCategory     mv_category);
 void              ops_set_modelview      (RenderOpBuilder         *builder,
                                           const graphene_matrix_t *mv,
-                                          GskMatrixCategory        mv_category);
+                                          GskTransformCategory     mv_category);
 void              ops_pop_modelview      (RenderOpBuilder         *builder);
 float             ops_get_scale          (const RenderOpBuilder   *builder);
 
index 795a8ed37c47bd19423981b8f6ce56f233830f78..aa6978cfe4f9ce09b6155f2e80b1aec96ede39c2 100644 (file)
@@ -170,4 +170,42 @@ typedef enum {
   GSK_SERIALIZATION_INVALID_DATA
 } GskSerializationError;
 
+/**
+ * GskTransformCategory:
+ * @GSK_TRANSFORM_CATEGORY_UNKNOWN: The category of the matrix has not been
+ *     determined.
+ * @GSK_TRANSFORM_CATEGORY_ANY: Analyzing the matrix concluded that it does
+ *     not fit in any other category.
+ * @GSK_TRANSFORM_CATEGORY_2D: The matrix is a 3D matrix. This means that
+ *     the w column (the last column) has the values (0, 0, 0, 1).
+ * @GSK_TRANSFORM_CATEGORY_2D: The matrix is a 2D matrix. This is equivalent
+ *     to graphene_matrix_is_2d() returning %TRUE. In particular, this
+ *     means that Cairo can deal with the matrix.
+ * @GSK_TRANSFORM_CATEGORY_2D_AFFINE: The matrix is a combination of 2D scale
+ *     and 2D translation operations. In particular, this means that any
+ *     rectangle can be transformed exactly using this matrix.
+ * @GSK_TRANSFORM_CATEGORY_2D_TRANSLATE: The matrix is a 2D translation.
+ * @GSK_TRANSFORM_CATEGORY_IDENTITY: The matrix is the identity matrix.
+ *
+ * The categories of matrices relevant for GSK and GTK. Note that any
+ * category includes matrices of all later categories. So if you want
+ * to for example check if a matrix is a 2D matrix,
+ * `category >= GSK_TRANSFORM_CATEGORY_2D` is the way to do this.
+ *
+ * Also keep in mind that rounding errors may cause matrices to not
+ * conform to their categories. Otherwise, matrix operations done via
+ * mutliplication will not worsen categories. So for the matrix
+ * multiplication `C = A * B`, `category(C) = MIN (category(A), category(B))`.
+ */
+typedef enum
+{
+  GSK_TRANSFORM_CATEGORY_UNKNOWN,
+  GSK_TRANSFORM_CATEGORY_ANY,
+  GSK_TRANSFORM_CATEGORY_3D,
+  GSK_TRANSFORM_CATEGORY_2D,
+  GSK_TRANSFORM_CATEGORY_2D_AFFINE,
+  GSK_TRANSFORM_CATEGORY_2D_TRANSLATE,
+  GSK_TRANSFORM_CATEGORY_IDENTITY
+} GskTransformCategory;
+
 #endif /* __GSK_TYPES_H__ */
index 0066a37072bc490e63e9a84bb048d05a1c50fe27..11cb612a87b01e894a95edc57101382dfb4f341f 100644 (file)
@@ -2441,7 +2441,7 @@ gsk_transform_node_serialize (GskRenderNode *node)
   graphene_matrix_to_float (&matrix, mat);
 
   return g_variant_new (GSK_TRANSFORM_NODE_VARIANT_TYPE,
-                        gsk_transform_categorize (self->transform),
+                        gsk_transform_get_category (self->transform),
                         (double) mat[0], (double) mat[1], (double) mat[2], (double) mat[3],
                         (double) mat[4], (double) mat[5], (double) mat[6], (double) mat[7],
                         (double) mat[8], (double) mat[9], (double) mat[10], (double) mat[11],
index 744e96cd97622367d44b584550da03e56d8d27a1..df47602526dab8da3dd1a38ca0ae43316010c66c 100644 (file)
@@ -6,44 +6,6 @@
 
 G_BEGIN_DECLS
 
-/*<private>
- * GskMatrixCategory:
- * @GSK_MATRIX_CATEGORY_UNKNOWN: The category of the matrix has not been
- *     determined.
- * @GSK_MATRIX_CATEGORY_ANY: Analyzing the matrix concluded that it does
- *     not fit in any other category.
- * @GSK_MATRIX_CATEGORY_INVERTIBLE: The matrix is linear independant and
- *     should therefor be invertible. Note that this is not guaranteed
- *     to actually be true due to rounding errors when inverting.
- * @GSK_MATRIX_CATEGORY_2D: The matrix is a 2D matrix. This is equivalent
- *     to graphene_matrix_is_2d() returning %TRUE. In particular, this
- *     means that Cairo can deal with the matrix.
- * @GSK_MATRIX_CATEGORY_2D_AFFINE: The matrix is a combination of 2D scale
- *     and 2D translation operations. In particular, this means that any
- *     rectangle can be transformed exactly using this matrix.
- * @GSK_MATRIX_CATEGORY_2D_TRANSLATE: The matrix is a 2D translation.
- * @GSK_MATRIX_CATEGORY_IDENTITY: The matrix is the identity matrix.
- *
- * The categories of matrices relevant for GSK and GTK. Note that any
- * category includes matrices of all later categories. So if you want
- * to for example check if a matrix is a 2D matrix,
- * `category >= GSK_MATRIX_CATEGORY_2D` is the way to do this.
- *
- * Also keep in mind that rounding errors may cause matrices to not
- * conform to their categories. Otherwise, matrix operations done via
- * mutliplication will not worsen categories. So for the matrix
- * multiplication `C = A * B`, `category(C) = MIN (category(A), category(B))`.
- */
-typedef enum
-{
-  GSK_MATRIX_CATEGORY_UNKNOWN,
-  GSK_MATRIX_CATEGORY_ANY,
-  GSK_MATRIX_CATEGORY_INVERTIBLE,
-  GSK_MATRIX_CATEGORY_2D_AFFINE,
-  GSK_MATRIX_CATEGORY_2D_TRANSLATE,
-  GSK_MATRIX_CATEGORY_IDENTITY
-} GskMatrixCategory;
-
 typedef struct _GskRenderNodeClass GskRenderNodeClass;
 
 #define GSK_IS_RENDER_NODE_TYPE(node,type) (GSK_IS_RENDER_NODE (node) && (node)->node_class->node_type == (type))
index 555af722943d6d3fb2ce40e6c4e42b882b083f10..6ec0541aa7985298f290950e8811df7ddc531ce8 100644 (file)
@@ -53,7 +53,7 @@ struct _GskTransformClass
   const char *type_name;
 
   void                  (* finalize)            (GskTransform           *transform);
-  GskMatrixCategory     (* categorize)          (GskTransform           *transform);
+  GskTransformCategory  (* categorize)          (GskTransform           *transform);
   void                  (* to_matrix)           (GskTransform           *transform,
                                                  graphene_matrix_t      *out_matrix);
   gboolean              (* apply_2d)            (GskTransform           *transform,
@@ -124,10 +124,10 @@ gsk_identity_transform_finalize (GskTransform *transform)
 {
 }
 
-static GskMatrixCategory
+static GskTransformCategory
 gsk_identity_transform_categorize (GskTransform *transform)
 {
-  return GSK_MATRIX_CATEGORY_IDENTITY;
+  return GSK_TRANSFORM_CATEGORY_IDENTITY;
 }
 
 static void
@@ -254,7 +254,7 @@ struct _GskMatrixTransform
   GskTransform parent;
 
   graphene_matrix_t matrix;
-  GskMatrixCategory category;
+  GskTransformCategory category;
 };
 
 static void
@@ -262,7 +262,7 @@ gsk_matrix_transform_finalize (GskTransform *self)
 {
 }
 
-static GskMatrixCategory
+static GskTransformCategory
 gsk_matrix_transform_categorize (GskTransform *transform)
 {
   GskMatrixTransform *self = (GskMatrixTransform *) transform;
@@ -302,25 +302,26 @@ gsk_matrix_transform_apply_affine (GskTransform *transform,
 
   switch (self->category)
   {
-    case GSK_MATRIX_CATEGORY_UNKNOWN:
-    case GSK_MATRIX_CATEGORY_ANY:
-    case GSK_MATRIX_CATEGORY_INVERTIBLE:
+    case GSK_TRANSFORM_CATEGORY_UNKNOWN:
+    case GSK_TRANSFORM_CATEGORY_ANY:
+    case GSK_TRANSFORM_CATEGORY_3D:
+    case GSK_TRANSFORM_CATEGORY_2D:
     default:
       return FALSE;
 
-    case GSK_MATRIX_CATEGORY_2D_AFFINE:
+    case GSK_TRANSFORM_CATEGORY_2D_AFFINE:
       *out_dx += *out_scale_x * graphene_matrix_get_value (&self->matrix, 3, 0);
       *out_dy += *out_scale_y * graphene_matrix_get_value (&self->matrix, 3, 1);
       *out_scale_x *= graphene_matrix_get_value (&self->matrix, 0, 0);
       *out_scale_y *= graphene_matrix_get_value (&self->matrix, 1, 1);
       return TRUE;
 
-    case GSK_MATRIX_CATEGORY_2D_TRANSLATE:
+    case GSK_TRANSFORM_CATEGORY_2D_TRANSLATE:
       *out_dx += *out_scale_x * graphene_matrix_get_value (&self->matrix, 3, 0);
       *out_dy += *out_scale_y * graphene_matrix_get_value (&self->matrix, 3, 1);
       return TRUE;
 
-    case GSK_MATRIX_CATEGORY_IDENTITY:
+    case GSK_TRANSFORM_CATEGORY_IDENTITY:
       return TRUE;
   }
 }
@@ -334,19 +335,20 @@ gsk_matrix_transform_apply_translate (GskTransform *transform,
 
   switch (self->category)
   {
-    case GSK_MATRIX_CATEGORY_UNKNOWN:
-    case GSK_MATRIX_CATEGORY_ANY:
-    case GSK_MATRIX_CATEGORY_INVERTIBLE:
-    case GSK_MATRIX_CATEGORY_2D_AFFINE:
+    case GSK_TRANSFORM_CATEGORY_UNKNOWN:
+    case GSK_TRANSFORM_CATEGORY_ANY:
+    case GSK_TRANSFORM_CATEGORY_3D:
+    case GSK_TRANSFORM_CATEGORY_2D:
+    case GSK_TRANSFORM_CATEGORY_2D_AFFINE:
     default:
       return FALSE;
 
-    case GSK_MATRIX_CATEGORY_2D_TRANSLATE:
+    case GSK_TRANSFORM_CATEGORY_2D_TRANSLATE:
       *out_dx += graphene_matrix_get_value (&self->matrix, 3, 0);
       *out_dy += graphene_matrix_get_value (&self->matrix, 3, 1);
       return TRUE;
 
-    case GSK_MATRIX_CATEGORY_IDENTITY:
+    case GSK_TRANSFORM_CATEGORY_IDENTITY:
       return TRUE;
   }
   return TRUE;
@@ -421,7 +423,7 @@ static const GskTransformClass GSK_TRANSFORM_TRANSFORM_CLASS =
 GskTransform *
 gsk_transform_matrix_with_category (GskTransform            *next,
                                     const graphene_matrix_t *matrix,
-                                    GskMatrixCategory        category)
+                                    GskTransformCategory     category)
 {
   GskMatrixTransform *result = gsk_transform_alloc (&GSK_TRANSFORM_TRANSFORM_CLASS, next);
 
@@ -444,7 +446,7 @@ GskTransform *
 gsk_transform_matrix (GskTransform            *next,
                       const graphene_matrix_t *matrix)
 {
-  return gsk_transform_matrix_with_category (next, matrix, GSK_MATRIX_CATEGORY_UNKNOWN);
+  return gsk_transform_matrix_with_category (next, matrix, GSK_TRANSFORM_CATEGORY_UNKNOWN);
 }
 
 /*** TRANSLATE ***/
@@ -463,15 +465,15 @@ gsk_translate_transform_finalize (GskTransform *self)
 {
 }
 
-static GskMatrixCategory
+static GskTransformCategory
 gsk_translate_transform_categorize (GskTransform *transform)
 {
   GskTranslateTransform *self = (GskTranslateTransform *) transform;
 
   if (self->point.z != 0.0)
-    return GSK_MATRIX_CATEGORY_INVERTIBLE;
+    return GSK_TRANSFORM_CATEGORY_3D;
 
-  return GSK_MATRIX_CATEGORY_2D_TRANSLATE;
+  return GSK_TRANSFORM_CATEGORY_2D_TRANSLATE;
 }
 
 static void
@@ -650,10 +652,10 @@ gsk_rotate_transform_finalize (GskTransform *self)
 {
 }
 
-static GskMatrixCategory
+static GskTransformCategory
 gsk_rotate_transform_categorize (GskTransform *transform)
 {
-  return GSK_MATRIX_CATEGORY_INVERTIBLE;
+  return GSK_TRANSFORM_CATEGORY_3D;
 }
 
 static void
@@ -821,15 +823,15 @@ gsk_scale_transform_finalize (GskTransform *self)
 {
 }
 
-static GskMatrixCategory
+static GskTransformCategory
 gsk_scale_transform_categorize (GskTransform *transform)
 {
   GskScaleTransform *self = (GskScaleTransform *) transform;
 
   if (self->factor_z != 1.0)
-    return GSK_MATRIX_CATEGORY_INVERTIBLE;
+    return GSK_TRANSFORM_CATEGORY_3D;
 
-  return GSK_MATRIX_CATEGORY_2D_AFFINE;
+  return GSK_TRANSFORM_CATEGORY_2D_AFFINE;
 }
 
 static void
@@ -1315,21 +1317,21 @@ gsk_transform_equal (GskTransform *first,
   return first->transform_class->equal (first, second);
 }
 
-/*<private>
- * gsk_transform_categorize:
- * @self: (allow-none): A matrix
- *
+/**
+ * gsk_transform_get_category:
+ * @self: (allow-none): A #GskTransform
  *
+ * Returns the category this transform belongs to.
  *
- * Returns: The category this matrix belongs to
+ * Returns: The category of the transform
  **/
-GskMatrixCategory
-gsk_transform_categorize (GskTransform *self)
+GskTransformCategory
+gsk_transform_get_category (GskTransform *self)
 {
   if (self == NULL)
-    return GSK_MATRIX_CATEGORY_IDENTITY;
+    return GSK_TRANSFORM_CATEGORY_IDENTITY;
 
-  return MIN (gsk_transform_categorize (self->next),
+  return MIN (gsk_transform_get_category (self->next),
               self->transform_class->categorize (self));
 }
 
index 78aeb5597551a3a048d8ecdc8ad2a2a9e66e3ccf..c38955fa264edae125946177c67e07e8710cf38b 100644 (file)
@@ -25,6 +25,7 @@
 #error "Only <gsk/gsk.h> can be included directly."
 #endif
 
+#include <gsk/gskenums.h>
 #include <gsk/gsktypes.h>
 
 G_BEGIN_DECLS
@@ -66,6 +67,8 @@ gboolean                gsk_transform_to_translate              (GskTransform
                                                                  float                          *out_dx,
                                                                  float                          *out_dy) G_GNUC_WARN_UNUSED_RESULT;
 
+GDK_AVAILABLE_IN_ALL
+GskTransformCategory    gsk_transform_get_category              (GskTransform                   *self) G_GNUC_PURE;
 GDK_AVAILABLE_IN_ALL
 gboolean                gsk_transform_equal                     (GskTransform                   *first,
                                                                  GskTransform                   *second) G_GNUC_PURE;
index 0aba516f25354aa3378ea164bf483c8f00138032..5ea45e03fb29e09f5a7e162597f94dc3d0f0b486 100644 (file)
 
 G_BEGIN_DECLS
 
-GskMatrixCategory       gsk_transform_categorize                (GskTransform           *self);
-
 GskTransform *          gsk_transform_matrix_with_category      (GskTransform           *next,
                                                                  const graphene_matrix_t*matrix,
-                                                                 GskMatrixCategory       category);
+                                                                 GskTransformCategory    category);
 
 G_END_DECLS
 
index 191810562ea6845d8dda97ea627e60e2830f02a0..1a85e0c69737552881f23ad2cfd99f2ee494e177 100644 (file)
@@ -1270,7 +1270,7 @@ gtk_snapshot_transform_matrix (GtkSnapshot             *snapshot,
 void
 gtk_snapshot_transform_matrix_with_category (GtkSnapshot             *snapshot,
                                              const graphene_matrix_t *matrix,
-                                             GskMatrixCategory        category)
+                                             GskTransformCategory     category)
 {
   GtkSnapshotState *state;
 
index 536c7c08cf4aa8e6cde5e1345e0d0af85852706a..d5ae52ba5107d3452e6c966c5a53f90907075c20 100644 (file)
@@ -104,7 +104,7 @@ GtkSnapshot *           gtk_snapshot_new_with_parent            (GtkSnapshot
 void                    gtk_snapshot_transform_matrix_with_category
                                                                 (GtkSnapshot            *snapshot,
                                                                  const graphene_matrix_t*matrix,
-                                                                 GskMatrixCategory       category);
+                                                                 GskTransformCategory    category);
 void                    gtk_snapshot_append_text                (GtkSnapshot            *snapshot,
                                                                  PangoFont              *font,
                                                                  PangoGlyphString       *glyphs,
index c4eb7c51ecc1165b18f257109f44e880bbd15c89..d87225d63bda0057c69fe98cc1732d13ec17732b 100644 (file)
@@ -4334,9 +4334,9 @@ gtk_widget_allocate (GtkWidget    *widget,
   graphene_matrix_init_translate (&priv->transform, &GRAPHENE_POINT3D_INIT (adjusted.x, adjusted.y, 0));
   gsk_transform_to_matrix (transform, &transform_matrix);
   graphene_matrix_multiply (&priv->transform, &transform_matrix, &priv->transform);
-  priv->transform_category = gsk_transform_categorize (transform);
+  priv->transform_category = gsk_transform_get_category (transform);
   if (adjusted.x || adjusted.y)
-    priv->transform_category = MIN (priv->transform_category, GSK_MATRIX_CATEGORY_2D_TRANSLATE);
+    priv->transform_category = MIN (priv->transform_category, GSK_TRANSFORM_CATEGORY_2D_TRANSLATE);
 
   if (!alloc_needed && !size_changed && !baseline_changed)
     {
index 569268ae2b571bab74e7b9dd506bed9db4b434b2..c8b872d8db66615f07b0493ff32814ed0f6f6244 100644 (file)
@@ -150,7 +150,7 @@ struct _GtkWidgetPrivate
   gint allocated_size_baseline;
 
   graphene_matrix_t transform;
-  GskMatrixCategory transform_category;
+  GskTransformCategory transform_category;
   int width;
   int height;
   int baseline;
index ff6b40911bf0829f468a11defc283eddb698a919..788d96d72a91815a12adc5f3e03b01a1029f6938 100644 (file)
@@ -890,12 +890,13 @@ populate_render_node_properties (GtkListStore  *store,
     case GSK_TRANSFORM_NODE:
       {
         static const char * category_names[] = {
-          [GSK_MATRIX_CATEGORY_UNKNOWN] = "unknown",
-          [GSK_MATRIX_CATEGORY_ANY] = "any",
-          [GSK_MATRIX_CATEGORY_INVERTIBLE] = "invertible",
-          [GSK_MATRIX_CATEGORY_2D_AFFINE] = "2D affine",
-          [GSK_MATRIX_CATEGORY_2D_TRANSLATE] = "2D transform",
-          [GSK_MATRIX_CATEGORY_IDENTITY] = "identity"
+          [GSK_TRANSFORM_CATEGORY_UNKNOWN] = "unknown",
+          [GSK_TRANSFORM_CATEGORY_ANY] = "any",
+          [GSK_TRANSFORM_CATEGORY_3D] = "3D",
+          [GSK_TRANSFORM_CATEGORY_2D] = "2D",
+          [GSK_TRANSFORM_CATEGORY_2D_AFFINE] = "2D affine",
+          [GSK_TRANSFORM_CATEGORY_2D_TRANSLATE] = "2D translate",
+          [GSK_TRANSFORM_CATEGORY_IDENTITY] = "identity"
         };
         GskTransform *transform;
         char *s;
@@ -904,7 +905,7 @@ populate_render_node_properties (GtkListStore  *store,
         s = gsk_transform_to_string (transform);
         add_text_row (store, "Matrix", s);
         g_free (s);
-        add_text_row (store, "Category", category_names[gsk_transform_categorize (transform)]);
+        add_text_row (store, "Category", category_names[gsk_transform_get_category (transform)]);
       }
       break;